package com.authsphere.security.token.redis.strategy;

import org.springframework.data.redis.serializer.StringRedisSerializer;

/**
 * @program: AuthSphere
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/12 09:37
 **/
public abstract class StandardStringSerializationStrategy extends BaseRedisTokenStoreSerializationStrategy {

    private static final StringRedisSerializer STRING_SERIALIZER = new StringRedisSerializer();

    @Override
    protected String deserializeStringInternal(byte[] bytes) {
        return STRING_SERIALIZER.deserialize(bytes);
    }

    @Override
    protected byte[] serializeInternal(String string) {
        return STRING_SERIALIZER.serialize(string);
    }
}
